package com.example.demo.Entity;

import javax.persistence.*;
import java.io.Serializable;
import java.util.Date;

/**
 * 此处编辑人物属性类
 *
 * 要求
 * 必须有的有  主键（使用UUID 生成随机字符串） ，姓名，角色身份，创建时间（使用@column（inserting false，updating false）,最新修改时间(inserting false，updating true)）
 * 可为空的有  住址， 头像url（默认url） ，出入次数（默认0），身份证（13位字符串），年龄，昵称，微信openid
 * */

@Entity
@Table(name = "person")
public class Person implements Serializable {

    public static final long serialVersionUID = 1L;

    @Id
    @GeneratedValue
    private Long Id;                            //主键id
    @Column(name = "role")
    private String role;                        //角色
    @Column(name = "name")
    private String name;                        //账户名
    @Column(name = "password")
    private String password;                    //密码
    @Column(name = "realName")
    private String realName;                    //真实姓名
    @Column(name = "openId")
    private String openId;                      //微信识别码
    @Column(name = "area")
    private String area;                        //管辖区
    @Column(name = "createdTime")
    private Date createdTime;                   //创建时间
    @Column(name = "updatedTime")
    private Date updatedTime;                   //最近修改时间

    public Person(){
        super();
    }

    public Person(Long Id, String role, String name, String password, String realName, String openId, String area, Date createdTime, Date updatedTime){
        super();
        this.Id = Id;
        this.role = role;
        this.name = name;
        this.password = password;
        this.realName = realName;
        this.openId = openId;
        this.area = area;
        this.createdTime = createdTime;
        this.updatedTime = updatedTime;
    }

    public Long getId() {
        return Id;
    }

    public void setId(Long id) {
        Id = id;
    }

    public String getRole() {
        return role;
    }

    public void setRole(String role) {
        this.role = role;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public String getRealName() {
        return realName;
    }

    public void setRealName(String realName) {
        this.realName = realName;
    }

    public String getOpenId() {
        return openId;
    }

    public void setOpenId(String openId) {
        this.openId = openId;
    }

    public String getArea() {
        return area;
    }

    public void setArea(String locate) {
        this.area = locate;
    }

    public Date getCreatedTime() {
        return createdTime;
    }

    public void setCreatedTime(Date createdTime) {
        this.createdTime = createdTime;
    }

    public Date getUpdatedTime() {
        return updatedTime;
    }

    public void setUpdatedTime(Date updatedTime) {
        this.updatedTime = updatedTime;
    }
}
